#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2025/7/31 22:32
# @Author : yhb
# @File : yaml.config.py
# @Software: PyCharm
import yaml
import pymysql
#读取yaml文件的方法
class GetConf:
    def __init__(self):
        with open(r"C:\Users\yhb\PycharmProjects\code\trading_system_api_autotest\config\environment.yaml","r",encoding="utf-8") as file:
            self.env=yaml.load(file,Loader=yaml.FullLoader)["mysql"]
            print(self.env)

            print(self.env['db'],self.env['host'],self.env['password'],self.env['port'],self.env['user'])
    def get_url(self):
        return self.env["url"]


